<?php

use yii\db\Migration;

/**
 * Handles the creation of table `project_lawsuit`.
 */
class m171027_054635_create_project_lawsuit_table extends Migration
{
    /**
     * @inheritdoc
     * 预评估司法进展（原涉诉信息）表
     */
    public function up()
    {
        $this->createTable('project_pre_evaluation_lawsuit', [
            'id' => $this->bigPrimaryKey(),
            'mortgage_id' => $this->bigInteger()->comment('抵押ID'),//保证、混合类项目此项为空
            'project_id' => $this->bigInteger()->notNull(),
            'stage' => $this->string()->notNull()->comment('诉讼阶段'),
            'judgement' => $this->text()->notNull()->comment('判决'),
            'execution' => $this->text()->notNull()->comment('执行'),
            'court' => $this->string()->notNull()->comment('法院'),
            'block' => $this->text()->notNull()->comment('列失信'),
            'created_at' => $this->timestamp(),
        ]);
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('project_lawsuit');
    }
}
